SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE  PROCEDURE [dbo].[usp_ShowApplyingEmployeeRecordDetails]

	(
	@param_id INT
	)

AS
	/* SET NOCOUNT ON */
	
	SELECT dbo.JOL_Recruitment_ApplyingRecords.id,dbo.JOL_Recruitment.topic,position,resume_path, dbo.JOL_Recruitment_ApplyingRecords.add_time,dbo.JOL_Recruitment_ApplyingRecords.update_time,handle_time,last_stage,result,employinunit_message,applicant_message,JOL_Employee.JOL_Employee_Name,JOL_Employee.JOL_Employee_School,JOL_Employee.JOL_Employee_Profession,JOL_Employee.JOL_Employee_Longevity,JOL_Employee.JOL_Employee_Mobile,JOL_Employee.JOL_Employee_Email,JOL_Employee.JOL_Employee_StudyYearOut,JOL_Employee.JOL_Employee_Sex,JOL_Employee.JOL_Employee_Nation,JOL_Employee.JOL_Employee_Politics
	FROM dbo.JOL_Recruitment_ApplyingRecords,dbo.JOL_Recruitment_Position,dbo.JOL_Recruitment_Participants_apply,JOL_Recruitment,JOL_Employee
	WHERE
	
	 dbo.JOL_Recruitment_ApplyingRecords.recruit_position=dbo.JOL_Recruitment_Position.id AND
	 participants_apply=dbo.JOL_Recruitment_Participants_apply.id AND
	 
	 dbo.JOL_Recruitment_ApplyingRecords.id=@param_id AND 
	 dbo.JOL_Recruitment_ApplyingRecords.applicant_type='Employee'AND
	  dbo.JOL_Recruitment_Participants_apply.recruitment=JOL_Recruitment.id AND 
	  dbo.JOL_Recruitment_ApplyingRecords.applicant_userID=JOL_Employee.JOL_Employee_Account
	ORDER BY handle_time,dbo.JOL_Recruitment_ApplyingRecords.update_time,dbo.JOL_Recruitment_ApplyingRecords.add_time DESC
	
	RETURN
GO
